<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        document.onkeydown = function (event) {
            var event = event || window.event;
            console.log(event.keyCode);
        }
    </script>
</head>
<body>

</body>
</html>